package com.boot.customer.service;

import com.boot.core.BaseService;
import com.boot.customer.mapper.CustomerMapper;
import com.boot.customer.pojo.Customer;
import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
public class CustomerService extends BaseService<Customer> {

    @Autowired
    private CustomerMapper customerMapper;

    public List<Customer> findAll() {
        log.info("service------查询用户");
        PageHelper.startPage(1, 2);
        return this.customerMapper.selectAll();
    }

    public Customer findById(String id) {
        log.info("service------查询单个用户");
        return customerMapper.findById(id);
    }

}